package com.cjw.controller.systemManage;

import com.cjw.config.annotation.OperationLogAnnotation;
import com.cjw.pojo.dto.database.PageDTO;
import com.cjw.pojo.dto.systemManage.ExamineDTO;
import com.cjw.pojo.dto.systemManage.PassDTO;
import com.cjw.pojo.query.systemManage.ExamineQuery;
import com.cjw.service.systemManage.ExamineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : cjw
 * @date: : 2022/2/27 9:55
 * @description : 审核资源
 */
@RestController
@RequestMapping("/admin/examine")
@Api("审核资源")
public class ExamineController {
    @Autowired
    private ExamineService examineService;

    @PostMapping("/findListExamine")
    @ApiOperation("查看全部审核")
    @OperationLogAnnotation(operModul = "系统管理-平台内容审核",operType = "查看全部审核记录",operDesc = "查询")
    public PageDTO<List<ExamineDTO>> findListExamine(@RequestBody ExamineQuery examineQuery) {
        return examineService.findListExamine(examineQuery);
    }

    @PostMapping("/pass")
    @ApiOperation("通过审核")
    @OperationLogAnnotation(operModul = "系统管理-平台内容审核",operType = "通过审核",operDesc = "修改")
    public Boolean pass(@RequestBody PassDTO passDTO) {
        return examineService.pass(passDTO);
    }

    @PostMapping("/unpass")
    @ApiOperation("不通过审核")
    @OperationLogAnnotation(operModul = "系统管理-平台内容审核",operType = "不通过审核",operDesc = "修改")
    public Boolean unpass(@RequestBody PassDTO passDTO) {
        return examineService.unpass(passDTO);
    }
}
